#include<iostream>
#include<algorithm>
#include<cstdio>
using namespace std;
typedef long long LL;
const int N = 1e3 + 10;
struct node
{
	int id;
	int x;
}s[N];
int n;
int cmp(node a, node b)
{
	return a.x < b.x;
}
int main()
{
	cin >> n;
	int x;
	for (int i = 0; i < n; i++) {
		cin >> x;
		s[i] = { i + 1,x };
	}
	sort(s, s + n, cmp);
	for (int i = 0; i < n; i++) {
		cout << s[i].id << " ";
	}
	cout << endl;
	double ans = 0;
	LL sum = 0;
	int k = n - 1;
	for (int i = 0; i < n; i++) {
		sum += (LL) s[i].x * k;
		k--;
	}
	ans = (sum * 1.0) / n;
	printf("%.2lf\n", ans);
	return 0;
}